export const tableOption = {
  border: true,
  index: true,
  indexLabel: "序号",
  stripe: true,
  menuAlign: "center",
  align: "center",
  searchMenuSpan: 6,
  labelPosition: "right",
  labelWidth: 110,
  editBtn: false,
  delBtn: false,
  searchEnter: true,
  column: [
    {
      type: "select",
      label: "人员名称",
      prop: "personName",
      span: 12,
      dicUrl:
        "/admin-api/o3-workorder/personcredentialmanage/getPersonCredentialList",
      props: {
        label: "personName",
        value: "personName",
      },
      dicMethod: "get",
      display: true,
      hide: false,
      /*      rules: [
        {
          required: true,
          trigger: 'blur',
          message: "人员名称不能为空"
        }
      ],*/
      formslot: true,
    },
    {
      type: "input",
      label: "员工号",
      prop: "jobNo",
      span: 12,
      disabled: true,
      display: true,
      hide: false,
    },
    {
      type: "input",
      label: "资质等级",
      prop: "credentialGrade",
      span: 12,
      disabled: true,
      display: true,
      hide: false,
    },
    {
      type: "select",
      label: "班次",
      prop: "shiftId",
      span: 12,
      dicUrl: "/admin-api/o3-workorder/shiftmanage/getShiftManageList",
      props: {
        label: "shiftName",
        value: "id",
      },
      dicMethod: "get",
      formslot: true,
      display: true,
      hide: false,
    },
    {
      type: "input",
      label: "班次名称",
      prop: "shiftName",
      span: 12,
      labelWidth: 110,
      display: false,
      hide: true,
    },
    {
      type: "input",
      label: "归属产线Id",
      prop: "productLineId",
      span: 12,
      labelWidth: 110,
      display: false,
      hide: true,
    },
    {
      type: "input",
      label: "归属产线",
      prop: "productLineName",
      span: 12,
      labelWidth: 110,
      disabled: true,
      display: true,
      hide: false,
      formslot: true,
    },
    {
      type: "input",
      label: "岗位工段",
      prop: "workshopSection",
      disabled: true,
      span: 12,
      formslot: true,
    },
    {
      type: "input",
      label: "厂内技能",
      prop: "skill",
      span: 12,
      dicMethod: "get",
      disabled: true,
      display: true,
      hide: false,
    },
    {
      type: "input",
      label: "岗位工序",
      prop: "processId",
      span: 12,
      display: true,
      hide: true,
      formslot: true,
    },
    {
      type: "input",
      label: "岗位工序",
      prop: "processName",
      span: 12,
      labelWidth: 110,
      display: false,
      hide: false,
    },
    {
      type: "input",
      label: "分配状态",
      prop: "processName",
      span: 12,
      labelWidth: 110,
      display: false,
      hide: false,
      html: true, //配置html设置为true即可支持formatter转义html代码
      formatter: (val) => {
        if (val.skill.includes(val.processName)) {
          return '<b style="color:green">对口</b>';
        } else {
          return '<b style="color:red">不对口</b>';
        }
      },
    },
    {
      label: "岗位状态",
      prop: "postStatus",
      type: "switch",
      dicData: [
        {
          label: "待岗",
          value: "1",
        },
        {
          label: "在岗",
          value: "0",
        },
      ],
      value: "0",
      html: true, //配置html设置为true即可支持formatter转义html代码
      formatter: (val) => {
        if (val.postStatus == "1") {
          return '<b style="color:red">待岗</b>';
        } else if (val.postStatus == "0") {
          return '<b style="color:green">在岗</b>';
        }
      },
    },
    {
      label: "岗位类别",
      prop: "postClass",
      type: "switch",
      dicData: [
        {
          label: "副岗",
          value: "1",
        },
        {
          label: "主岗",
          value: "0",
        },
      ],
      value: "0",
      html: true, //配置html设置为true即可支持formatter转义html代码
      formatter: (val) => {
        if (val.postClass == "1") {
          return '<b style="color:orange">副岗</b>';
        } else if (val.postClass == "0") {
          return '<b style="color:orangered">主岗</b>';
        }
      },
    },
  ],
};
